package com.ruoyi.project.cms.content.service;

import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.cms.content.domain.CmsContent;
import com.ruoyi.project.cms.content.domain.ContentVo;
import com.ruoyi.project.cms.content.mapper.ContentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: zhizun
 * @author: Mrs.ye
 * @create: 2020-09-16 10:04
 * @description:
 **/
@Service
public class ContentServiceImpl implements IContentService {

    @Autowired
    private ContentMapper contentMapper;
    @Override
    public List<ContentVo> selectContentList(CmsContent cmsContent) {
        return contentMapper.selectContentList(cmsContent);
    }

    @Override
    public int insertContent(CmsContent cmsContent) {
        cmsContent.setCreateBy(ShiroUtils.getLoginName());
        return contentMapper.insertContent(cmsContent);
    }

    @Override
    public int deleteContentByIds(Long[] ids) {
        return contentMapper.deleteContentByIds(ids);
    }

    @Override
    public CmsContent selectContentById(Long contentId) {
        return contentMapper.selectContentById(contentId);
    }
}
